<%-- 
    Document   : menu_category
    Created on : Nov 27, 2011, 4:30:05 PM
    Author     : Ngoc Linh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<div id="menu_cat">
    <ul id="list_level1_cat">
        <li id="all_cat"><a href="#">Tất cả danh mục</a> 
            <c:if test="${applicationScope.danhMucMenu.size() > 0}">
                <div id="all_cat_container">
                    <c:forEach var="dm" items="${applicationScope.danhMucMenu}">
                        <div class="cat_detail">
                            <h4>${dm.tenDanhMuc}</h4>
                            <c:if test="${dm.danhmucs.size() > 0}">
                                <ul>
                                    <c:forEach var="dmc" items="${dm.danhmucs}" step="1">
                                        <c:url value="listproduct.do" var="listproduct_link">
                                            <c:param name="numberProducts" value="6" />
                                            <c:param name="page" value="1" />
                                            <c:param name="maDanhMuc" value="${dmc.maDanhMuc}" />
                                        </c:url>
                                        <li>
                                            <a href="/DauGia/${listproduct_link}">${dmc.tenDanhMuc} <span class="num_pro_cat">(${dmc.sanphams.size()})</span></a>
                                        </li>  
                                    </c:forEach> 
                                </ul>                                                   
                            </c:if>                            
                        </div>
                    </c:forEach>                                    
                </div>
            </c:if>            
        </li>
        <c:if test="${applicationScope.danhMucMenu.size() > 0}">
            <c:forEach var="dm" items="${applicationScope.danhMucMenu}" step="1">
                <c:url value="listproduct.do" var="listproduct_link">
                    <c:param name="numberProducts" value="6" />
                    <c:param name="page" value="1" />
                    <c:param name="maDanhMuc" value="${dm.maDanhMuc}" />
                </c:url>
                <li>
                    <a href="/DauGia/${listproduct_link}">${dm.tenDanhMuc}</a>
                    <ul class="show_sub_cat">
                        <c:if test="${dm.danhmucs.size() > 0}">
                            <c:forEach var="dmc" items="${dm.danhmucs}" step="1">
                                <c:url value="listproduct.do" var="listproduct_link">
                                    <c:param name="numberProducts" value="6" />
                                    <c:param name="page" value="1" />
                                    <c:param name="maDanhMuc" value="${dmc.maDanhMuc}" />
                                </c:url>
                                <li>
                                    <a href="/DauGia/${listproduct_link}">${dmc.tenDanhMuc}</a>
                                </li>  
                            </c:forEach>                    
                        </c:if> 
                    </ul>
                </li>
            </c:forEach>
        </c:if> 
    </ul>
</div>
<!--END MENU-CAT-->